package com.example.springboottools.utils.ruiyin;

import ink.rayin.htmladapter.base.PdfGenerator;
import ink.rayin.htmladapter.openhtmltopdf.service.PdfBoxGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.URL;

public class RaYinPdfTest {
    static Logger logger = LoggerFactory.getLogger(RaYinPdfUtils.class);
    static PdfGenerator pdfGenerator;
    static  {
        try {
            pdfGenerator = new PdfBoxGenerator();
            URL fontDirUrl = RaYinPdfUtils.class.getClassLoader().getResource("font");
            pdfGenerator.init(fontDirUrl.getPath());
            //  pdfGenerator.init();
        } catch (Exception e) {
            logger.error("初始化pdf生成器失败", e);
        }
    }


}
